import Vue from 'vue'
import Router from 'vue-router'
import Main from 'components/main/main'


import answerSheetP from 'components/answerSheet/answerSheet-p'//detail
import Topic from 'components/topic/topic-main'
import Payresult from 'components/pay/pay-result'
Vue.use(Router)
const router = new Router({
  routes: [
    {
      path: '/',
      name: 'main',
      component: Main,
      meta: {
        title: ''
      }
    },
    // {
    //   path: '/detail/:sku',
    //   name: 'Detail',
    //   component: Detail
    // },
    // 答题卡组件
    // {
    //   path: '/detail/:sku',
    //   name: 'answerSheet',
    //   component: answerSheet,

    // },
    {
      path: '/answerP/:sku',
      name: 'answerSheetP',
      component: answerSheetP,

    },
    {
      path: '/topic/:sku',
      name: 'topic',
      component: Topic,
    },
    {
      path: '/pay/result',
      name: 'Payresult',
      component: Payresult,
    },

  ]
})
router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})
export default router
